From: vhanquez@gwig.uk.xensource.com Date: Sat, 29 Jul 2006 13:05:59 +0000 (+0100) Subject: Limit the number of opened transactions per connection to 5. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15764 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=d763fcc1635f3dfc4af6da15a3f329cbe0e3e14e;p=xen.git Limit the number of opened transactions per connection to 5. Signed-off-by: Vincent Hanquez --- diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c index f9d844e045..a3f2157256 100644 --- a/tools/xenstore/xenstored_transaction.c +++ b/tools/xenstore/xenstored_transaction.c @@ -125,6 +125,7 @@ void do_transaction_start(struct connection *conn, struct buffered_data *in) { struct transaction *trans, *exists; char id_str[20]; + int started; /* We don't support nested transactions. */ if (conn->transaction) { @@ -132,6 +133,15 @@ void do_transaction_start(struct connection *conn, struct buffered_data *in) return; } + started = 0; + list_for_each_entry(trans, &conn->transaction_list, list) + started++; + + if (started > 5) { + send_error(conn, ENOSPC); + return; + } + /* Attach transaction to input for autofree until it's complete */ trans = talloc(in, struct transaction); INIT_LIST_HEAD(&trans->changes);